โจ ๊ฒฝ๊ธฐ์ฌ์ด๋ฒ๋์๊ด ๋ฐฐ๋์กฐํ API
- URI : /api/banners
- Method : GET
- Parameter Type : Query Param
- Product Env Request URL : https://www.library.kr/cyber/api/banners
๐ฎ Request
- type : ์๋น์ค ํ๋ซํผ ์ฝ๋
BPEB : ์ ์์ฑ
์๋น์ค
BPUR : ์ ์ ํํ์ด์ง
BPPT : ํ๋ฐฐ ์๋น์ค
BPBK : ๋ถ๋งค์ง
- example code
const url = 'https://www.library.kr/cyber/api/banners?type=BPUR';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
๐ Response
- response model
banSeq : ๋ฐฐ๋ ๊ณ ์ ๋ฒํธ (ํ์ธ์ฉ)
fixYn : ๊ณ ์ ์ฌ๋ถ (ํ์ธ์ฉ) (Y or N ๋ฐํ)
banImage : ์ ์ฅ๋ ์ด๋ฏธ์ง ์ด๋ฆ (e.g. 'dasd3434aasdhkji4f.png' )
banImageOriginal : ์ด๋ฏธ์ง ์๋ณธ๋ช
(e.g. '2024๋
_๊ณต๋ชจ์ .png')
banLink : ๋ฐฐ๋๋งํฌ (e.g. 'http://www.naver.com')
banActStart : ๊ฒ์ํ์ฑํ ์์์ผ (ํ์ธ์ฉ)
banActEnd : ๊ฒ์ํ์ฑํ ์ข
๋ฃ์ผ (ํ์ธ์ฉ)
๐ก ์ด๋ฏธ์ง ํธ์ถ์ ์๋์ ๊ฐ์ด ํด์ฃผ์ธ์. (๋ฐํ๋ banImage ํ๋ผ๋ฏธํฐ ์ฌ์ฉ)
- https://www.library.kr/cyber/upload/image/ecs/{banImage}
์ฑ๊ณต์
- 200 OK
{
"httpStatus": "OK",
"message": "OK",
"data": [
{
"banSeq": 1,
"fixYn": "Y",
"banImage": "",
"banImageOriginal": "",
"banLink": "https://www.naver.com",
"banActStart": "2024-07-31T15:00:00.000+00:00",
"banActEnd": "2024-08-27T15:00:00.000+00:00"
},
{
"banSeq": 2,
"fixYn": "Y",
"banImage": "",
"banImageOriginal": "",
"banLink": "https://www.naver.com",
"banActStart": "2024-08-01T15:00:00.000+00:00",
"banActEnd": "2024-08-11T15:00:00.000+00:00"
},
{
"banSeq": 3,
"fixYn": "N",
"banImage": "",
"banImageOriginal": "",
"banLink": "https://www.naver.com",
"banActStart": "2024-08-02T15:00:00.000+00:00",
"banActEnd": "2024-08-28T15:00:00.000+00:00"
},
{
"banSeq": 4,
"fixYn": "Y",
"banImage": "",
"banImageOriginal": "",
"banLink": "https://www.naver.com",
"banActStart": "2024-08-03T15:00:00.000+00:00",
"banActEnd": "2024-08-29T16:00:00.000+00:00"
}
]
}
์คํจ์ - type null or undefined
- 400 BAD REQUEST
{
"httpStatus": "BAD_REQUEST",
"errorCode": null,
"errorResult": null,
"message": "type is required",
"errors": null
}
์คํจ์ - ์ ์๋์ง ์์ type ๊ฐ (request ๋จ ๋ฌธ์๋ฅผ ํ์ธํด ์ฃผ์ธ์)
- 400 BAD REQUEST
{
"httpStatus": "BAD_REQUEST",
"errorCode": null,
"errorResult": null,
"message": "Invalid type. type must be one of ์ ์์ฑ
์๋น์ค : BPEB , ์ ์ ํํ์ด์ง : BPUR , ํ๋ฐฐ์๋น์ค : BPPT , ๋ถ๋งค์ง : BPBK",
"errors": null
}